QTW 42 - Poor Playback Performance with QTW 2.0

Technical Q&As


QTW 42 - Poor Playback Performance with QTW 2.0 (1-July-95)


Q We are upgrading one of our multimedia applications from QuickTime 1.1 for Windows to QuickTime 2.0 for Windows. When we run our application with QuickTime 2.0, the performance of the video is much poorer than with 1.1. The sound starts for the movie, but it takes a long time for the video to start playing, and we miss many seconds of the video before it gets going.

Our application runs on both Mac and Windows, and both platforms use the same movie file, which is flattened and Cinepak-compressed. The movie is quite long, and we play short segments of it.

We are very concerned because our QuickTime performance dramatically degraded when we switched to QuickTime 2.0 for Windows. The Mac version seems OK.

The following is our calling sequence to QuickTime:

Select portion of movie to play...

 MCDoAction (movieControl, mcActionSetPlaySelection, (LPVOID)TRUE);

 // Set the part of the movie we want to play
 MCDoAction (movieControl, mcActionSetSelectionBegin, & (movieInfo.begin));
 MCDoAction (movieControl, mcActionSetSelectionDuration, &length);

 // Go to the beginning of the movie portion
 MCDoAction (movieControl, mcActionGoToTime, &(movieInfo.begin));

Activate...

 SetMovieActive (theMovie, TRUE);

Play...

 PrerollMovie (theMovie, 0, GetMoviePreferredRate(theMovie));

 // Tell the controller to play the video
 MCDoAction (movieControl, mcActionPlay, (LPVOID)MAKELFIXED(1,0));

 // Deactivate the movie controller so mouse clicks don't stop the movie.
 // We can do this safely as the movie has started playing
 MCActivate (movieControl, hCanvasWnd, FALSE);


A The second parameter you pass to PrerollMovie() is hard-coded to 0 (zero). This causes the beginning of the movie to be pre-rolled, not the beginning of the section. You should pass in "movieInfo.begin" or MCGetCurrentTime(), whichever is more appropriate to the context.

This bug was not apparent before because QTW 1.x did the proper prerolling for you. QTW 2.0.x no longer prerolls automatically, so developers must assume the responsibility for doing it properly.

Technical Q&As
Previous Question | Contents | Next Question